using System.Data;
using ET;
namespace DAL
{
    public class Currency_DAL
    {
        private readonly clsConnect cls = new clsConnect();

        #region Getdata
        public DataTable BindGirdtb_Currency(string keywords)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@KeyWords", keywords);
            return cls.GetData("sp_tb_Currency_Search");
        }
        public DataTable BindGirdtb_CurrencyDetail(int id)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Currency_Id", id);
            return cls.GetData("sp_tb_Currency_Detail");
        }
        #endregion

        #region Insert
        public bool Inserttb_Currency(Currency_ET data)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Currency_Alias", data.Currency_Alias);
            cls.AddParameter("@Currency_Name", data.Currency_Name);
            cls.AddParameter("@Currency_Note", data.Currency_Note);
            cls.AddParameter("@Currency_User_Add", data.Currency_User_Add);
            cls.AddParameter("@Currency_Date_Add", data.Currency_Date_Add);
            cls.AddParameter("@Currency_Computer_Add", data.Currency_Computer_Add);
            return cls.ExecuteNonQuery("sp_tb_Currency_Insert");
        }
        #endregion

        #region Update
        public bool Updatetb_Currency(Currency_ET data)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Currency_ID", data.Currency_ID);
            cls.AddParameter("@Currency_Alias", data.Currency_Alias);
            cls.AddParameter("@Currency_Name", data.Currency_Name);
            cls.AddParameter("@Currency_Note", data.Currency_Note);
            cls.AddParameter("@Currency_User_Modify", data.Currency_User_Modify);
            cls.AddParameter("@Currency_Date_Modify", data.Currency_Date_Modify);
            cls.AddParameter("@Currency_Computer_Modify", data.Currency_Computer_Modify);
            return cls.ExecuteNonQuery("sp_tb_Currency_Update");
        }
        #endregion

        #region Delete
        public bool Deletetb_Currency(int id)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Currency_ID", id);
            cls.ExecuteNonQuery("sp_tb_Currency_Delete");
            return true;
        }
        #endregion
    }
}